﻿using UnityEngine;
using System.Collections;

public class Bullet : MonoBehaviour 
{
	public float m_Speed;
	public string target;
	// Update is called once per frame
	void Update () 
	{
		transform.position += new Vector3(m_Speed*Time.deltaTime, 0, 0);
	}
	void OnTriggerEnter2D(Collider2D _other)
	{
		if (_other.gameObject.tag == target)
		{
			Destroy(_other.gameObject);
			Destroy (gameObject);
		}
	}
}
